package Lab1;

public class BMICalculator {
    public static void main(String[] args) {
        int weight = Integer.parseInt(args[0]);
        double height = Double.parseDouble(args[1]);
        double BMI = weight / Math.pow(height, 2);
        String status;
        if (BMI < 18.5) {
            status = "Underweight";
        } else if (18.5 <= BMI && BMI <= 24.9) {
            status = "Normal";
        } else if (25 <= BMI && BMI <= 29.9) {
            status = "Overweight";
        } else {
            status = "Obese";
        }
        String BMIFormat = String.format("%.2f", BMI);
        System.out.println("Your weight: " + weight + " kg \n" +
                "Your height: " + height + " m \n" +
                "Your BMI: " + BMIFormat + " \n" +
                "You are in the " + status + " range.");
    }
}
